package com.qf.smsplatfrom.controller;

import com.qf.smsplatfrom.dto.R;
import com.qf.smsplatfrom.pojo.TMenu;
import com.qf.smsplatfrom.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/menu")
public class MenuController {

    private MenuService menuService;

    @Autowired
    public void setMenuService(MenuService menuService) {
        this.menuService = menuService;
    }

    @PostMapping("/menu")
    public R modifyMenu(@RequestBody TMenu tMenu) {

        menuService.modifyByName(tMenu);

        return R.setOk();
    }

}
